home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Tcl-Tk 8.0 / Pre-installed version / Tcl README < prev    next >
Encoding:
Text File  |  1997-08-15  |  17.6 KB  |  380 lines  |  [TEXT/ALFA]

  1. Tcl
  2.  
  3. SCCS: @(#) README 1.49 97/08/14 08:47:31
  4.  
  5. 1. Introduction
  6. ---------------
  7.  
  8. This directory and its descendants contain the sources and documentation
  9. for Tcl, an embeddable scripting language.  The information here
  10. corresponds to release 8.0. Tcl 8.0 is a major new release that replaces
  11. the core of the interpreter with an on-the-fly bytecode compiler to
  12. improve execution speed.  It also includes several other new features
  13. such as namespaces and binary I/O, plus many bug fixes.  The compiler
  14. introduces a few incompatibilities that may affect existing Tcl scripts;
  15. the incompatibilities are relatively obscure but may require
  16. modifications to some old scripts before they can run with this version.
  17. The compiler introduces many new C-level APIs, but the old APIs are
  18. still supported. See below for more details.
  19.  
  20. 2. Documentation
  21. ----------------
  22.  
  23. The best way to get started with Tcl is to read one of the introductory
  24. books on Tcl:
  25.  
  26.     Tcl and the Tk Toolkit, by John Ousterhout,
  27.     Addison-Wesley, 1994, ISBN 0-201-63337-X
  28.  
  29.     Practical Programming in Tcl and Tk, by Brent Welch,
  30.     Prentice-Hall, 1995, ISBN 0-13-182007-9
  31.  
  32.     Exploring Expect, by Don Libes,
  33.     O'Reilly and Associates, 1995, ISBN 1-56592-090-2
  34.  
  35. The "doc" subdirectory in this release contains a complete set of reference
  36. manual entries for Tcl.  Files with extension ".1" are for programs (for
  37. example, tclsh.1); files with extension ".3" are for C library procedures;
  38. and files with extension ".n" describe Tcl commands.  The file "doc/Tcl.n"
  39. gives a quick summary of the Tcl language syntax.  To print any of the man
  40. pages, cd to the "doc" directory and invoke your favorite variant of
  41. troff using the normal -man macros, for example
  42.  
  43.         ditroff -man Tcl.n
  44.  
  45. to print Tcl.n.  If Tcl has been installed correctly and your "man"
  46. program supports it, you should be able to access the Tcl manual entries
  47. using the normal "man" mechanisms, such as
  48.  
  49.         man Tcl
  50.  
  51. There is also an official home for Tcl and Tk on the Web:
  52.     http://sunscript.sun.com
  53. These Web pages include information about the latest releases, products
  54. related to Tcl and Tk, reports on bug fixes and porting issues, HTML
  55. versions of the manual pages, and pointers to many other Tcl/Tk Web
  56. pages at other sites.  Check them out!
  57.  
  58. 3. Compiling and installing Tcl
  59. -------------------------------
  60.  
  61. This release contains everything you should need to compile and run
  62. Tcl under UNIX, Macintoshes, and PCs (either Windows NT, Windows 95,
  63. or Win 3.1 with Win32s).
  64.  
  65. Before trying to compile Tcl you should do the following things:
  66.  
  67.     (a) Check for a binary release.  Pre-compiled binary releases are
  68.         available now for PCs, Macintoshes, and several flavors of UNIX.
  69.         Binary releases are much easier to install than source releases.
  70.         To find out whether a binary release is available for your
  71.         platform, check the home page for SunScript
  72.         (http://sunscript.sun.com) under "Tech Corner".  Also, check in
  73.         the FTP directory from which you retrieved the base
  74.         distribution.  Some of the binary releases are available freely,
  75.         while others are for sale.
  76.  
  77.     (b) Make sure you have the most recent patch release.  Look in the
  78.     FTP directory from which you retrieved this distribution to see
  79.     if it has been updated with patches.  Patch releases fix bugs
  80.     without changing any features, so you should normally use the
  81.     latest patch release for the version of Tcl that you want. 
  82.     Patch releases are available in two forms.  A file like
  83.     tcl8.0p1.tar.Z is a complete release for patch level 1 of Tcl
  84.     version 8.0.  If there is a file with a higher patch level than
  85.     this release, just fetch the file with the highest patch level
  86.     and use it.
  87.  
  88.     Patches are also available in the form of patch files that just
  89.     contain the changes from one patch level to another.  These
  90.     files will have names like tcl8.0p1.patch, tcl8.0p2.patch, etc.  They
  91.     may also have .gz or .Z extensions to indicate compression.  To
  92.     use one of these files, you apply it to an existing release with
  93.     the "patch" program.  Patches must be applied in order:
  94.     tcl8.0p1.patch must be applied to an unpatched Tcl 8.0 release
  95.     to produce a Tcl 8.0p1 release;  tcl8.0p2.patch can then be
  96.     applied to Tcl8.0p1 to produce Tcl 8.0p2, and so on. To apply an
  97.     uncompressed patch file such as tcl8.0p1.patch, invoke a shell
  98.     command like the following from the directory containing this
  99.     file:
  100.         patch -p < tcl8.0p1.patch
  101.     If the patch file has a .gz extension, invoke a command like the
  102.     following:
  103.         gunzip -c tcl8.0p1.patch.gz | patch -p
  104.     If the patch file has a .Z extension, it was compressed with
  105.     compress.  To apply it, invoke a command like the following:
  106.         zcat tcl8.0p1.patch.Z | patch -p
  107.     If you're applying a patch to a release that has already been
  108.     compiled, then before applying the patch you should cd to the
  109.     "unix" subdirectory and type "make distclean" to restore the
  110.     directory to a pristine state.
  111.  
  112. Once you've done this, change to the "unix" subdirectory if you're
  113. compiling under UNIX, "win" if you're compiling under Windows, or
  114. "mac" if you're compiling on a Macintosh.  Then follow the instructions
  115. in the README file in that directory for compiling Tcl, installing it,
  116. and running the test suite.
  117.  
  118. 4. Summary of changes in Tcl 8.0
  119. --------------------------------
  120.  
  121. Here are the most significant changes in Tcl 8.0.  In addition to these
  122. changes, there are several smaller changes and bug fixes.  See the file
  123. "changes" for a complete list of all changes.
  124.  
  125.     1. Bytecode compiler.  The core of the Tcl interpreter has been
  126.     replaced with an on-the-fly compiler that translates Tcl scripts to
  127.     byte codes; a new interpreter then executes the byte codes. In
  128.     earlier versions of Tcl, strings were used as a universal
  129.     representation;  in Tcl 8.0 strings are replaced with Tcl_Obj
  130.     structures ("objects") that can hold both a string value and an
  131.     internal form such as a binary integer or compiled bytecodes.  The
  132.     new objects make it possible to store information in efficient
  133.     internal forms and avoid the constant translations to and from
  134.     strings that occurred with the old interpreter.  We have not yet
  135.     converted all of Tcl to take full advantage of the compiler and
  136.     objects and have not converted any of Tk yet, but even so you
  137.     should see speedups of 2-3x on many programs and you may see
  138.     speedups as much as 10-20x in some cases (such as code that
  139.     manipulates long lists).  Future releases should achieve even
  140.     greater speedups.  The compiler introduces only a few minor changes
  141.     at the level of Tcl scripts, but it introduces many new C APIs for
  142.     managing objects.  See, for example, the manual entries doc/*Obj*.3.
  143.  
  144.     2. Namespaces.  There is a new namespace mechanism based on the
  145.     namespace implementation by Michael McLennan of Lucent Technologies.
  146.     This includes new "namespace" and "variable" commands.  There are
  147.     many new C APIs associated with namespaces, but they will not be
  148.     exported until Tcl 8.1.  Note: the syntax of the namespace command
  149.     has been changed slightly since the b1 release.  See the changes
  150.     file for details.
  151.  
  152.     3. Binary I/O.  The new object system in Tcl 8.0 supports binary
  153.     strings (internally, strings are counted in addition to being null
  154.     terminated).  There is a new "binary" command for inserting and
  155.     extracting data to/from binary strings.  Commands such as "puts",
  156.     "gets", and "read" commands now operate correctly on binary data. 
  157.     There is a new variable tcl_platform(byteOrder) to identify the
  158.     native byte order for the current host.
  159.  
  160.     4. Random numbers.  The "expr" command now contains a random number
  161.     generator, which can be accessed via the "rand()" and "srand()" math
  162.     functions.
  163.  
  164.     5. Safe-Tcl enhancements.  There is a new "hidden command"
  165.     mechanism, implemented with the Tcl commands "interp hide", "interp
  166.     expose", "interp invokehidden", and "interp hidden" and the C APIs
  167.     Tcl_HideCommand and Tcl_ExposeCommand.  There is now support for
  168.     safe packages and extension loading, including new library
  169.     procedures such as safe::interpCreate (see the manual entry safe.n
  170.     for details).
  171.  
  172.     6. There is a new package "registry" available under Windows for
  173.     accessing the Windows registry.
  174.  
  175.     7. There is a new command "file attributes" for getting and setting
  176.     things like permissions and owner.  There is also a new command
  177.     "file nativename" for getting back the platform-specific name for a
  178.     particular file.
  179.  
  180.     8. There is a new "fcopy" command to copy data between channels. 
  181.     This replaces and improves upon the not-so-secret unsupported old
  182.     command "unsupported0".
  183.  
  184.     9. There is a new package "http" for doing GET, POST, and HEAD
  185.     requests via the HTTP/1.0 protocol.  See the manual entry http.n
  186.     for details.
  187.  
  188.     10. There are new library procedures for finding word breaks in
  189.     strings.  See the manual entry library.n for details.
  190.  
  191.     11. There are new C APIs Tcl_Finalize (for cleaning up before
  192.     unloading the Tcl DLL) and Tcl_Ungets for pushing bytes back into a
  193.     channel's input buffer.
  194.  
  195.     12. Tcl now supports serial I/O devices on Windows and Unix, with a
  196.     new fconfigure -mode option.  The Windows driver does not yet
  197.     support event-driven I/O.
  198.  
  199.     13. The lsort command has new options -dictionary and -index.  The
  200.     -index option allows for very rapid sorting based on an element
  201.     of a list.
  202.  
  203.     14. The event notifier has been completely rewritten (again).  It
  204.     should now allow Tcl to use an external event loop (like Motif's)
  205.     when it is embedded in other applications.  No script-level
  206.     interfaces have changed, but many of the C APIs have.
  207.  
  208. Tcl 8.0 introduces the following incompatibilities that may affect Tcl
  209. scripts that worked under Tcl 7.6 and earlier releases:
  210.  
  211.     1. Variable and command names may not include the character sequence
  212.     "::" anymore: this sequence is now used as a namespace separator.
  213.  
  214.     2. The semantics of some Tcl commands have been changed slightly to
  215.     maximize performance under the compiler.  These incompatibilities
  216.     are documented on the Web so that we can keep the list up-to-date.
  217.     See the URL http://www.sunlabs.com/research/tcl/compiler.html.
  218.  
  219.     3. 2-digit years are now parsed differently by the "clock" command
  220.     to handle year 2000 issues better (years 00-38 are treated as
  221.     2000-2038 instead of 1900-1938).
  222.  
  223.     4. The old Macintosh commands "cp", "mkdir", "mv", "rm", and "rmdir"
  224.     are no longer supported; all of these features are now available on
  225.     all platforms via the "file" command.
  226.  
  227.     5. The variable tcl_precision is now shared between interpreters
  228.     and defaults to 12 digits instead of 6; safe interpreters cannot
  229.     modify tcl_precision.  The new object system in Tcl 8.0 causes
  230.     floating-to-string conversions (and the associated rounding) to
  231.     occur much less often than in Tcl 7.6, which can sometimes cause
  232.     behavioral changes.
  233.  
  234.     6. The C APIs associated with the notifier have changed substantially.
  235.  
  236.     7. The procedures Tcl_CreateModalTimeout and Tcl_DeleteModalTimeout
  237.     have been removed.
  238.  
  239.     8. Tcl_CreateFileHandler and Tcl_DeleteFileHandler now take Unix
  240.     fd's and are only supported on the Unix platform
  241.  
  242.     9. The C APIs for creating channel drivers have changed as part of
  243.     the new notifier implementation.  The Tcl_File interfaces have been
  244.     removed.  Tcl_GetChannelFile has been replaced with
  245.     Tcl_GetChannelHandle.  Tcl_MakeFileChannel now takes a platform-
  246.     specific file handle.  Tcl_DriverGetOptionProc procedures now take
  247.     an additional interp argument.
  248.  
  249. 5. Tcl newsgroup
  250. -----------------
  251.  
  252. There is a network news group "comp.lang.tcl" intended for the exchange
  253. of information about Tcl, Tk, and related applications.  Feel free to use
  254. the newsgroup both for general information questions and for bug reports.
  255. We read the newsgroup and will attempt to fix bugs and problems reported
  256. to it.
  257.  
  258. When using comp.lang.tcl, please be sure that your e-mail return address
  259. is correctly set in your postings.  This allows people to respond directly
  260. to you, rather than the entire newsgroup, for answers that are not of
  261. general interest.  A bad e-mail return address may prevent you from
  262. getting answers to your questions.  You may have to reconfigure your news
  263. reading software to ensure that it is supplying valid e-mail addresses.
  264.  
  265. 6. Tcl contributed archive
  266. --------------------------
  267.  
  268. Many people have created exciting packages and applications based on Tcl
  269. and/or Tk and made them freely available to the Tcl community.  An archive
  270. of these contributions is kept on the machine ftp.neosoft.com.  You
  271. can access the archive using anonymous FTP;  the Tcl contributed archive is
  272. in the directory "/pub/tcl".  The archive also contains several FAQ
  273. ("frequently asked questions") documents that provide solutions to problems
  274. that are commonly encountered by TCL newcomers.
  275.  
  276. 7. Mailing lists
  277. ----------------
  278.  
  279. A couple of  Mailing List have been set up to discuss Macintosh or
  280. Windows related Tcl issues.  In order to use these Mailing Lists you
  281. must have access to the internet.  If you have access to the WWW the
  282. home pages for these mailing lists are located at the following URLs:
  283.  
  284.     http://www.sunlabs.com/research/tcl/lists/mactcl-list.html
  285.  
  286.         -and-
  287.  
  288.     http://www.sunlabs.com/research/tcl/lists/wintcl-list.html
  289.  
  290. The home pages contain information about the lists and an HTML archive
  291. of all the past messages on the list.  To subscribe send a message to:
  292.     
  293.     listserv@sunlabs.sun.com
  294.     
  295. In the body of the message (the subject will be ignored) put:
  296.     
  297.     subscribe mactcl Joe Blow
  298.     
  299. Replacing Joe Blow with your real name, of course.  (Use wintcl
  300. instead of mactcl if your interested in the Windows list.)  If you
  301. would just like to receive more information about the list without
  302. subscribing put the line:
  303.  
  304.     information mactcl
  305.     
  306. in the body instead (or wintcl).
  307.  
  308. 8. Support and bug fixes
  309. ------------------------
  310.  
  311. We're very interested in receiving bug reports and suggestions for
  312. improvements.  We prefer that you send this information to the
  313. comp.lang.tcl newsgroup rather than to any of us at Sun.  We'll see
  314. anything on comp.lang.tcl, and in addition someone else who reads 
  315. comp.lang.tcl may be able to offer a solution.  The normal turn-around
  316. time for bugs is 3-6 weeks.  Enhancements may take longer and may not
  317. happen at all unless there is widespread support for them (we're
  318. trying to slow the rate at which Tcl turns into a kitchen sink).  It's
  319. very difficult to make incompatible changes to Tcl at this point, due
  320. to the size of the installed base.
  321.  
  322. When reporting bugs, please provide a short tclsh script that we can
  323. use to reproduce the bug.  Make sure that the script runs with a
  324. bare-bones tclsh and doesn't depend on any extensions or other
  325. programs, particularly those that exist only at your site.  Also,
  326. please include three additional pieces of information with the
  327. script:
  328.     (a) how do we use the script to make the problem happen (e.g.
  329.     what things do we click on, in what order)?
  330.     (b) what happens when you do these things (presumably this is
  331.         undesirable)?
  332.     (c) what did you expect to happen instead?
  333.  
  334. The Tcl community is too large for us to provide much individual
  335. support for users.  If you need help we suggest that you post questions
  336. to comp.lang.tcl.  We read the newsgroup and will attempt to answer
  337. esoteric questions for which no-one else is likely to know the answer.
  338. In addition, Tcl support and training are available commercially from
  339. NeoSoft (info@neosoft.com), Computerized Processes Unlimited
  340. (gwl@cpu.com), and Data Kinetics (education@dkl.com).
  341.  
  342. 9. Tcl version numbers
  343. ----------------------
  344.  
  345. Each Tcl release is identified by two numbers separated by a dot, e.g.
  346. 6.7 or 7.0.  If a new release contains changes that are likely to break
  347. existing C code or Tcl scripts then the major release number increments
  348. and the minor number resets to zero: 6.0, 7.0, etc.  If a new release
  349. contains only bug fixes and compatible changes, then the minor number
  350. increments without changing the major number, e.g. 7.1, 7.2, etc.  If
  351. you have C code or Tcl scripts that work with release X.Y, then they
  352. should also work with any release X.Z as long as Z > Y.
  353.  
  354. Alpha and beta releases have an additional suffix of the form a2 or b1.
  355. For example, Tcl 7.0b1 is the first beta release of Tcl version 7.0,
  356. Tcl 7.0b2 is the second beta release, and so on.  A beta release is an
  357. initial version of a new release, used to fix bugs and bad features before
  358. declaring the release stable.  An alpha release is like a beta release,
  359. except it's likely to need even more work before it's "ready for prime
  360. time".  New releases are normally preceded by one or more alpha and beta
  361. releases.  We hope that lots of people will try out the alpha and beta
  362. releases and report problems.  We'll make new alpha/beta releases to fix
  363. the problems, until eventually there is a beta release that appears to
  364. be stable.  Once this occurs we'll make the final release.
  365.  
  366. We can't promise to maintain compatibility among alpha and beta releases.
  367. For example, release 7.1b2 may not be backward compatible with 7.1b1, even
  368. though the final 7.1 release will be backward compatible with 7.0.  This
  369. allows us to change new features as we find problems during beta testing.
  370. We'll try to minimize incompatibilities between beta releases, but if
  371. a major problem turns up then we'll fix it even if it introduces an
  372. incompatibility.  Once the official release is made then there won't
  373. be any more incompatibilities until the next release with a new major
  374. version number.
  375.  
  376. Patch releases have a suffix such as p1 or p2.  These releases contain
  377. bug fixes only.  A patch release (e.g Tcl 7.6p2) should be completely
  378. compatible with the base release from which it is derived (e.g. Tcl
  379. 7.6), and you should normally use the highest available patch release.
  380.